/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package maps;

import java.awt.Point;
import java.util.ArrayList;

/**
 *
 * @author menderleit
 */
public class DungeonRoom {
    
    private int xPos;
    private int yPos;
    private int width;
    private int height;
    private ArrayList<Point> entrance;
    private int numEntrances;
    
    public DungeonRoom(int x, int y, int roomWidth, int roomHeight) {
        xPos = x;
        yPos = y;
        width = roomWidth;
        height = roomHeight;
        entrance = new ArrayList();
        numEntrances = 0;
    }
    
    public void addEntrance(int x, int y) {
        entrance.add(new Point(x, y));
        numEntrances++;
    }
    
    public Point getEntrance(int index) {
        Point p = null;
        if(index >= 0 && index < entrance.size()) {
            p = entrance.get(index);
        }
        return p;
    }
    
    public void removeEntrance(int index) {
        if(index >= 0 && index < entrance.size()) {
            entrance.remove(index);
            numEntrances--;
        }
    }
    
    public int getNumEntrances() {
        return numEntrances;
    }
    
    public Point getPosition() {
        return new Point(xPos, yPos);
    }

    public int getXPosition() {
        return xPos;
    }
    
    public int getYPosition() {
        return yPos;
    }
    
    public int getWidth() {
        return width;
    }
    
    public int getHeight() {
        return height;
    }
    
    public Point getUR() {
        return new Point(xPos+width-1, yPos);
    }
    
    public Point getLR() {
        return new Point(xPos+width-1, yPos+height-1);
    }
    
    public Point getLL() {
        return new Point(xPos, yPos+height-1);
    }
}
